const express = require("express");
const app = express();
//引入数据库连接文件
require("./db");


//引入外部路由
const addAdminRoute = require("./routes/addAdmin")
const adminListRoute = require("./routes/adminList")
const deleteAdminRoute = require("./routes/deleteAdmin")
const loginRoute = require("./routes/login")

//处理post请求体的中间件
app.use(express.urlencoded());
app.use(express.json());

//使用路由
app.use(addAdminRoute)
app.use(adminListRoute)
app.use(deleteAdminRoute)
app.use(loginRoute)

app.listen("8000", () => {
  console.log("服务器启动成功");
});
